package com.lmk.t01;

import java.io.File;

public class Test04 {
    public static void main(String[] args) {
  Thread T1=new Thread(()-> {
      for (int i = 0; i <10 ; i++) {
          System.out.println(Thread.currentThread().getName()+"爬了100米");
          try {
              Thread.sleep(1000);
          } catch (InterruptedException e) {
              e.printStackTrace();
          }
         if(i==9){
             System.out.println(Thread.currentThread().getName()+"登顶了");
         }
      }
  },"年轻人");
        Thread T2=new Thread(()-> {
            for (int i = 0; i <10 ; i++) {
                System.out.println(Thread.currentThread().getName()+"爬了100米");
                try {
                    Thread.sleep(3000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                if(i==9){
                    System.out.println(Thread.currentThread().getName()+"登顶了");
                }
            }
        },"老年人");

        T1.start();
        T2.start();
    }
}